<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="/pages/js/jquery.min.js"></script>
    <script type="text/javascript">

        window.addEventListener('storage', function(e) {
            console.log(e.key + "'s value is changed from '" +
                    e.oldValue + "' to '" + e.newValue + "' by " + e.url);
        }, false);
        localStorage['foo'] = 'bar';
        $(function () {

            alert($.url().param('data'));

            $("#upload").click(function () {
                alert("aaaaaaa");
                var formData = new FormData();
                formData.append('upload', $('#file')[0].files[0]);
                $.ajax({
                    url: '/upload/image',
                    type: 'POST',
                    cache: false,
                    data: formData,
                    processData: false,
                    contentType: false
                }).done(function (res) {
                    $("#image").html('<img src="'+res.data+'">');
                    alert(res.data);
                    alert(JSON.stringify(res.data));

                }).fail(function (res) {

                });
            });
        })

        function ff() {
            window.location.href="admin.html";
        }
    </script>
</head>
<body>

<div id="uploadForm">
    <input id="file" type="file"/>
    <button id="upload" type="button">upload</button>
    <div id="image"><img src="#"></div>
</div>
<a href="javascript:void(0);" onclick="ff()">a标签测试</a>
<form action="/upload/image" enctype="multipart/form-data" method="post">
    <input name="upload" type="file">
    <input type="submit" value="提交">
</form>
</body>
</html>